@extends('home.layout.index')
@section('content')

<div class="i_bg">  
    <div class="content mar_20">
    	<img src="/home/juse/images/img2.jpg" />        
    </div>
    
    <!--Begin 第二步：确认订单信息 Begin -->
    <div class="content mar_20">
    	<div class="two_bg">
        	<div class="two_t">
            	<span class="fr"></span>商品列表
            </div>
            <table border="0" class="car_tab" style="width:1110px;" cellspacing="0" cellpadding="0">
              <tr>
                <td class="car_th" width="550">商品名称</td>
                <td class="car_th" width="140">属性</td>
                <td class="car_th" width="150">购买数量</td>
                <td class="car_th" width="130">小计</td>
              </tr>
              <tr>
                <td>
                    <div class="c_s_img"><img src="/home/juse/images/c_1.jpg" width="73" height="73" /></div>
                    {{$data['title']}}
                </td>
                <td align="center">{{$data['condition']}}</td>
                <td align="center">1</td>
                <td align="center" style="color:#ff4e00;">￥{{$data['reprice']}}</td>
               
              </tr>
            </table>
            
            <div class="two_t">
            	<span class="fr"></span>收货人信息
            </div>
            <table border="0" class="peo_tab" style="width:1110px;" cellspacing="0" cellpadding="0">
              <tr>
                <td class="p_td" width="160">商品名称</td>
                <td width="395">{{$data['title']}}</td>
                <td class="p_td" width="160">电子邮件</td>
                <td width="395">{{$user['email']}}</td>
              </tr>
              <tr>
                <td class="p_td">详细信息</td>
                <td>{{$userinfo['address']}}</td>
                <td class="p_td">邮政编码</td>
                <td>{{$userinfo['code']}}</td>
              </tr>
              <tr>
                <td class="p_td">姓名</td>
                <td id="uname">{{$userinfo['nickname']}}</td>
                <td class="p_td">手机</td>
                <td>{{$user['phone']}}</td>
              </tr>
              <input type="hidden" name="rid" value="{{$data['uid']}}" id="rid">
              <input type="hidden" name="uid" value="{{$userinfo['uid']}}" id="uid">
              <input type="hidden" name="gid" value="{{$data['id']}}" id="gid">
              <input type="hidden" name="name" value="{{$userinfo['nickname']}}" id="uaname">
              <input type="hidden" name="phone" value="{{$user['phone']}}" id="uaphone">
              <input type="hidden" name="address" value="{{$userinfo['address']}}" id="uadd">
              <input type="hidden" name="cost" value="{{$data['reprice']}}" id="ucost">
            </table>  
            <div class="two_t">
            	支付方式
            </div>
            <ul class="pay">
                <li class="checked">微信<div class="ch_img"></div></li>
                <li>支付宝<div class="ch_img"></div></li>
            </ul>
            <div class="two_t">
            	其他信息
            </div>
            <table border="0" class="car_tab" style="width:1110px;" cellspacing="0" cellpadding="0">
              
              <tr valign="top">
                <td align="right" style="padding-right:0;"><b style="font-size:14px;">订单附言：</b></td>
                <td style="padding-left:0;"><textarea class="add_txt" style="width:860px; height:50px;"></textarea></td>
              </tr>
              
            </table>
            
            <table border="0" style="width:900px; margin-top:20px;" cellspacing="0" cellpadding="0">
              <tr>
                
              </tr>
              <tr height="70">
                <td align="right">
                	<b style="font-size:14px;">应付款金额：<span style="font-size:22px; color:#ff4e00;">￥{{$data['reprice']}}</span></b>
                </td>
              </tr>
              <tr height="70">
                <td align="right"><a href="javascript:;" id="pay-btn"><img src="/home/juse/images/btn_sure.gif" /></a></td>
              </tr>
            </table>

            
        	
        </div>
    </div>
	<!--End 第二步：确认订单信息 End-->
    
    
</div>
// <script>
// 	    $.ajaxSetup({
// 	    headers: {
// 	        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
// 	    }
// 		});
// </script>
<script>
	$('#pay-btn').click(function(){
		var rid = $('#rid').val();
		var uid = $('#uid').val();
		var gid = $('#gid').val();
		var name = $('#uaname').val();
		var tel = $('#uaphone').val();
		var address = $('#uadd').val();
		var cost = $('#ucost').val();
		$.ajax({
			url:'/good/pay',
			type:'get',
			data:{'rid':rid,'uid':uid,'gid':gid,'name':name,'tel':tel,'address':address,'cost':cost},
			success : function(data){
				// console.log(data);
				if(data){
					window.location="/good/payaa/"+data;
				}
			},
		});
	})
</script>
@endsection